-- EmuProcsi -- Sum of integers from 1 to N -- Iterative example --

LOAD R0, #20        -- N
LOAD R1, #1         -- Current integer
LOAD R7, #0         -- Result : sum of integers from 1 to N

ADD R7, R1          -- Loop

LOAD R2, #0         -- Comparizon
ADD R2, R1
ADD R1, #1          -- Next integer

SUB R2, R0          -- Break if current integer = N
JEQ #10
JMP #3

HALT                -- R7 should contain 1+...+N = 210 = 0xD2
